﻿using Newtonsoft.Json;
using SqlSugar_Geometry_Model.Entity;
using SqlSugar_Geometry_Model.MyClass;
using SqlSugar_Geometry_Model.Service;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace SqlSugar_Geometry_Model.Ashx
{
    /// <summary>
    /// GetTest 的摘要说明
    /// </summary>
    public class GetTest : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            List<Test> tests = new DbService().getTests();   //获取所有Test数据
            String jsonstring = JsonConvert.SerializeObject(tests);  //将Test数据转换成Json字符串
            context.Response.Write(BaseClass.JsonIndentation(jsonstring));  //浏览器输出带缩进格式的Json数据
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}